Skip to content

feat(functions) update functions template to match new 'server' style#5063

Open
kallebysantos wants to merge 6 commits intosupabase:developfrom
kallebysantos:feat-update-functions-template-server-sdk
Open

feat(functions) update functions template to match new 'server' style#5063
kallebysantos wants to merge 6 commits intosupabase:developfrom
kallebysantos:feat-update-functions-template-server-sdk

Conversation

@kallebysantos
Copy link
Copy Markdown
Member

@kallebysantos kallebysantos commented Apr 10, 2026

What kind of change does this PR introduce?

Feature

What is the new behavior?

Apply withSupabase helper from @supabase/server

Additional context

A new optional flag --auth was introduced for the functions new command, chose between the auth access template:

  • always No credentials required - Open endpoints, wrappers that handle their own auth
  • apikey Valid publishable key or secret key - Use respectively for Client-facing, key-validated endpoints or Server-to-server, internal calls
  • user User JWT required - Authenticated user endpoints

Current default --auth always

--
Towards FUNC-563

- Creating different templates for 'functions new' command
- Handling '--auth' flag to specify which template use
@kallebysantos kallebysantos requested a review from a team as a code owner April 10, 2026 19:04
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 10, 2026

Coverage Report for CI Build 24408017002

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.06%) to 63.746%

Details

  • Coverage decreased (-0.06%) from the base build.
  • Patch coverage: 7 uncovered changes across 2 files (19 of 26 lines covered, 73.08%).
  • 111 coverage regressions across 8 files.

Uncovered Changes

File Changed Covered %
cmd/functions.go 6 1 16.67%
internal/functions/new/new.go 20 18 90.0%

Coverage Regressions

111 previously-covered lines in 8 files lost coverage.

File Lines Losing Coverage Coverage
internal/db/declarative/declarative.go 51 43.1%
internal/sso/update/update.go 23 51.81%
internal/sso/create/create.go 13 0.0%
internal/sso/remove/remove.go 8 54.17%
internal/sso/list/list.go 7 55.0%
internal/utils/git.go 5 57.14%
internal/vanity_subdomains/activate/activate.go 2 87.5%
internal/vanity_subdomains/check/check.go 2 87.5%

Coverage Stats

Coverage Status
Relevant Lines: 15375
Covered Lines: 9801
Line Coverage: 63.75%
Coverage Strength: 7.05 hits per line

💛 - Coveralls

@kallebysantos
Copy link
Copy Markdown
Member Author

WIP: Do not merge until @supabase/server be announced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants